package com.yinhe.music.common.emoji.core;


import com.yinhe.music.common.R;

import java.util.HashMap;

/**
 * Created by jian on 2016/6/23.
 * mabeijianxi@gmail.com
 */
public class ExpressionCache {
    //    TODO 每页数据资源，可自己定义，自己更改
    public static final String[] page_1 = new String[]{
            "[jx]emoji_1[/jx]", "[jx]emoji_2[/jx]", "[jx]emoji_3[/jx]",
            "[jx]emoji_4[/jx]", "[jx]emoji_5[/jx]", "[jx]emoji_6[/jx]",
            "[jx]emoji_7[/jx]", "[jx]emoji_8[/jx]", "[jx]emoji_9[/jx]",
            "[jx]emoji_10[/jx]", "[jx]emoji_11[/jx]", "[jx]emoji_12[/jx]",
            "[jx]emoji_13[/jx]", "[jx]emoji_14[/jx]", "[jx]emoji_15[/jx]",
            "[jx]emoji_16[/jx]", "[jx]emoji_17[/jx]", "[jx]emoji_18[/jx]",
            "[jx]emoji_19[/jx]", "[jx]emoji_20[/jx]", "[jx]emoji_21[/jx]",
            "[jx]emoji_22[/jx]", "[jx]emoji_23[/jx]", "[jx]emoji_24[/jx]",
            "[jx]emoji_25[/jx]", "[jx]emoji_26[/jx]", "[jx]emoji_27[/jx]",
            ""

    };
    public static final String[] page_2 = new String[]{
            "[jx]emoji_28[/jx]","[jx]emoji_29[/jx]","[jx]emoji_30[/jx]",
            "[jx]emoji_31[/jx]", "[jx]emoji_32[/jx]", "[jx]emoji_33[/jx]",
            "[jx]emoji_34[/jx]", "[jx]emoji_35[/jx]", "[jx]emoji_36[/jx]",
            "[jx]emoji_37[/jx]", "[jx]emoji_38[/jx]", "[jx]emoji_39[/jx]",
            "[jx]emoji_40[/jx]", "[jx]emoji_41[/jx]", "[jx]emoji_42[/jx]",
            "[jx]emoji_43[/jx]", "[jx]emoji_44[/jx]", "[jx]emoji_45[/jx]",
            "[jx]emoji_46[/jx]", "[jx]emoji_47[/jx]", "[jx]emoji_48[/jx]",
            "[jx]emoji_49[/jx]",  "[jx]emoji_50[/jx]", "[jx]emoji_52[/jx]",
            "[jx]emoji_53[/jx]",  "[jx]emoji_54[/jx]", "[jx]emoji_55[/jx]",
            ""
    };
    public static final String[] page_3 = new String[]{

            "[jx]emoji_56[/jx]", "[jx]emoji_57[/jx]", "[jx]emoji_58[/jx]",
            "[jx]emoji_59[/jx]", "[jx]emoji_60[/jx]", "[jx]emoji_61[/jx]",
            "[jx]emoji_62[/jx]", "[jx]emoji_63[/jx]", "[jx]emoji_64[/jx]",
            "[jx]emoji_65[/jx]", "[jx]emoji_66[/jx]", "[jx]emoji_67[/jx]",
            "[jx]emoji_68[/jx]", "[jx]emoji_69[/jx]", "[jx]emoji_70[/jx]",
            "", "", "",
            "", "", "",
            "", "", "",
            "", "", "",
            ""
    };


    /**
     * 所有的表情资源id缓存，增加效率
     */
    private static HashMap<String, Integer> allExpressionTable = new HashMap<String, Integer>();

    static {

        allExpressionTable.put(page_1[0], R.drawable.emoji_1
        );
        allExpressionTable.put(page_1[1], R.drawable.emoji_2
        );
        allExpressionTable.put(page_1[2], R.drawable.emoji_3
        );
        allExpressionTable.put(page_1[3], R.drawable.emoji_4
        );
        allExpressionTable.put(page_1[4], R.drawable.emoji_5
        );
        allExpressionTable.put(page_1[5], R.drawable.emoji_6
        );
        allExpressionTable.put(page_1[6], R.drawable.emoji_7
        );
        allExpressionTable.put(page_1[7], R.drawable.emoji_8
        );
        allExpressionTable.put(page_1[8], R.drawable.emoji_9
        );
        allExpressionTable.put(page_1[9], R.drawable.emoji_10
        );
        allExpressionTable.put(page_1[10], R.drawable.emoji_11
        );
        allExpressionTable.put(page_1[11], R.drawable.emoji_12
        );
        allExpressionTable.put(page_1[12], R.drawable.emoji_13
        );
        allExpressionTable.put(page_1[13], R.drawable.emoji_14
        );
        allExpressionTable.put(page_1[14], R.drawable.emoji_15
        );
        allExpressionTable.put(page_1[15], R.drawable.emoji_16
        );
        allExpressionTable.put(page_1[16], R.drawable.emoji_17
        );
        allExpressionTable.put(page_1[17], R.drawable.emoji_18
        );
        allExpressionTable.put(page_1[18], R.drawable.emoji_19
        );
        allExpressionTable.put(page_1[19], R.drawable.emoji_20
        );
        allExpressionTable.put(page_1[20], R.drawable.emoji_21
        );
        allExpressionTable.put(page_1[21], R.drawable.emoji_22
        );
        allExpressionTable.put(page_1[22], R.drawable.emoji_23
        );
        allExpressionTable.put(page_1[23], R.drawable.emoji_24
        );
        allExpressionTable.put(page_1[24], R.drawable.emoji_25
        );
        allExpressionTable.put(page_1[25], R.drawable.emoji_26
        );

        allExpressionTable.put(page_1[26], R.drawable.emoji_27
        );

        allExpressionTable.put(page_1[0], R.drawable.emoji_28
        );
        allExpressionTable.put(page_2[1], R.drawable.emoji_29
        );
        allExpressionTable.put(page_2[2], R.drawable.emoji_30
        );
        allExpressionTable.put(page_2[3], R.drawable.emoji_31
        );
        allExpressionTable.put(page_2[4], R.drawable.emoji_32
        );
        allExpressionTable.put(page_2[5], R.drawable.emoji_33
        );
        allExpressionTable.put(page_2[6], R.drawable.emoji_34
        );
        allExpressionTable.put(page_2[7], R.drawable.emoji_35
        );
        allExpressionTable.put(page_2[8], R.drawable.emoji_36
        );
        allExpressionTable.put(page_2[9], R.drawable.emoji_37
        );
        allExpressionTable.put(page_2[10], R.drawable.emoji_38
        );
        allExpressionTable.put(page_2[11], R.drawable.emoji_39
        );
        allExpressionTable.put(page_2[12], R.drawable.emoji_40
        );
        allExpressionTable.put(page_2[13], R.drawable.emoji_41
        );
        allExpressionTable.put(page_2[14], R.drawable.emoji_42
        );
        allExpressionTable.put(page_2[15], R.drawable.emoji_43
        );
        allExpressionTable.put(page_2[16], R.drawable.emoji_44
        );
        allExpressionTable.put(page_2[17], R.drawable.emoji_45
        );
        allExpressionTable.put(page_2[18], R.drawable.emoji_46
        );
        allExpressionTable.put(page_2[19], R.drawable.emoji_47
        );
        allExpressionTable.put(page_2[20], R.drawable.emoji_48
        );
        allExpressionTable.put(page_2[21], R.drawable.emoji_49
        );
        allExpressionTable.put(page_2[22], R.drawable.emoji_50
        );
        allExpressionTable.put(page_2[23], R.drawable.emoji_52
        );
        allExpressionTable.put(page_2[24], R.drawable.emoji_53
        );
        allExpressionTable.put(page_2[25], R.drawable.emoji_54
        );
        allExpressionTable.put(page_2[26], R.drawable.emoji_55
        );


        allExpressionTable.put(page_3[0], R.drawable.emoji_56
        );
        allExpressionTable.put(page_3[1], R.drawable.emoji_57
        );
        allExpressionTable.put(page_3[2], R.drawable.emoji_58
        );
        allExpressionTable.put(page_3[3], R.drawable.emoji_59
        );
        allExpressionTable.put(page_3[4], R.drawable.emoji_60
        );
        allExpressionTable.put(page_3[5], R.drawable.emoji_61
        );

        allExpressionTable.put(page_3[6], R.drawable.emoji_62
        );
        allExpressionTable.put(page_3[7], R.drawable.emoji_63
        );
        allExpressionTable.put(page_3[8], R.drawable.emoji_64
        );
        allExpressionTable.put(page_3[9], R.drawable.emoji_65
        );
        allExpressionTable.put(page_3[10], R.drawable.emoji_66
        );
        allExpressionTable.put(page_3[11], R.drawable.emoji_67
        );
        allExpressionTable.put(page_3[12], R.drawable.emoji_68
        );
        allExpressionTable.put(page_3[13], R.drawable.emoji_69
        );
        allExpressionTable.put(page_3[14], R.drawable.emoji_70
        );
    }

    /**
     * 最近使用表情缓存
     */
    private static String[] recentExpression = new String[21];
    /**
     * tab
     */
    private static String[] pageTitle;

    /**
     * 得到每类表情的标签，可拓展
     *
     * @return
     */
    public static String[] getPageTitle() {
        String category_1 = "最近";
//        String category_2 = "表情";
//        String category_3 = "表二";
        if (pageTitle == null) {
            pageTitle = new String[]{category_1};
        }
        return pageTitle;
    }

    public static String[] getRecentExpression() {
        return recentExpression;
    }

    public static HashMap<String, Integer> getAllExpressionTable() {
        return allExpressionTable;
    }
}